﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Advise.aspx.cs" Inherits="SF.Dict.Web.Advise" %>

<%@ Register Src="UserControls/ucHeader.ascx" TagName="ucHeader" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>谢谢您 | 挚友云海 | 收获于学习之外</title>
	<script type="text/javascript" src="/Common/jquery-1.3.2.js"></script>
	<link href="/Common/home.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
		.page-advise #main{
			width: 569px;
		}
		.page-advise #content {
			background: none repeat scroll 0 0 #FFFFFF;
			border-radius: 5px 5px 5px 5px;
			padding: 22px 28px;
			width: 569px;
		}
		h2#main-title {
			color: #324F65;
			font-size: 32px;
			font-weight: bold;
			margin: 0 0 30px;
		}
		a.blue-button {
			background: #2DA5D7;
			border: 1px solid #2192C1;
			border-radius: 4px 4px 4px 4px;
			color: #FFFFFF;
			cursor: pointer;
			display: block;
			font-size: 14px;
			height: 36px;
			line-height: 36px;
			padding: 0 20px;
			width: 50px;
			text-align: center;
			color: #FFF;
			margin: 0px auto;
		}
		textarea {
			border: 1px solid #E4E4E4;
			font-size: 16px;
			font-weight: bold;
			padding: 4px;
			width: 550px;
			overflow: auto;
			color: #4F545A;
			height: 180px;
			border-radius: 3px 3px 3px 3px;
			resize: none;
		}
		.hide {
			display: none;
		}
		#thankyou {
			float: right;
			margin-top: -60px;
			color: #CCC;
		}
	</style>
	<script type="text/javascript">

		$(document).ready(
			function () {
				$('#tb_advise').focus();

				$('#submit').bind("click", { fun: Advise, check: function () { return !($('#tb_advise').val().trim() != '') }, title: "保存成功，谢谢您！", argus: { again: false} }, ShowMiniHint);

			}
		);

		function Advise(argus) {
			var cmt = $('#tb_advise').val().trim();
			var again = argus.again;

			$.ajax({
				url: '/Submit/submit.ashx?page=advise&action=013&rnd=' + Math.random(),
				type: 'GET',
				timeout: 5000,
				dataType: "json",
				data: { 'cmt': cmt },
				error: function () {
					if (again) {
						AddMiniHint('重试失败，请稍候再试');
						HideMiniPop(1500);
					}
					else {
						AddMiniHint('保存失败，<a class="action" onclick="Advise({again:true})">请重试</a>');
					}
				},
				success: function (json) {
					if (json.code == 0) {
						AddMiniHint('保存成功，谢谢您！');
						$('#tb_advise').val();
						HideMiniPop(1000);
						$('#tb_advise').val('')
					}
					else {
						if (again) {
							AddMiniHint('重试失败，请稍候再试');
							HideMiniPop(1500);
						}
						else {
							AddMiniHint('保存失败，<a class="action" onclick="Advise({again:true})">请重试</a>');
						}
					}
				}
			});
		}
	
	</script>
</head>
<body>
	<form id="form1" runat="server">
	<div class="page-advise" id="wrap">
		<uc1:ucHeader ID="ucHeader1" PageName="Advise" runat="server" />
		<div id="content-holder">
			<div id="content">
				<div id="main">
					<h2 id="main-title">
						意见建议</h2>
					<span id="thankyou">谢谢您！</span>
					<asp:TextBox runat="server" ID="tb_advise" TextMode="MultiLine"></asp:TextBox>
					<div style="margin-top: 20px">
						<a class="blue-button" id="submit" href="javascript:void(0)">保存</a>
					</div>
				</div>
			</div>
			<div id="minipop-holder" class="hide">
				<div id="minipop-action" class="minipop">
					<div class="gray6">
						<div id="minipop-tip">
						</div>
					</div>
					<div class="btn-holder">
						<span><a id="minipop-submit" href="javascript:void(0)" class="action">确定</a></span>&nbsp;&nbsp;
						<span><a href="javascript:void(0)" onclick="HideMiniPop()" class="action">取消</a>
						</span>
					</div>
				</div>
				<div id="minipop-hint" class="minipop hide">
					<div class="gray6">
						<div id="minipop-hint-tip">
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</form>
</body>
</html>
